# -*- coding: utf-8 -*-

# @File  : million_test.py
# @Author: Lomo
# @Site  : lomo.space
# @Date  : 2019-12-03
# @Desc  : 百万数据


import random

from model._db import _DB

from utils.utill import Utils


if __name__ == '__main__':
    with _DB(host='localhost', port=3306, user='root', password='lomo16888', database='test') as db:
        for i in range(1000000):
            print(i)
            sql = "insert into user(name, phone, range_score) values('{0}', '{1}', {2})".format(
                Utils.chinese_content(random.randint(2, 5)), Utils.phone_number(), 11
            )
            print(sql)
            db.execute(sql)


